#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#define YES 1
#define NO 0

typedef struct{
	int a;
	int b;
} Rational;

typedef int status;

status InitRational(Rational *Res,int v1,int v2){
	Res->a=v1;
	Res->b=v2;
}

int Addition(Rational *A,Rational *B,Rational *Res){
	Res->a=A->a*B->b+A->b*B->a;
	Res->b=A->b*B->b;
}

int Subtraction(Rational *A,Rational *B,Rational *Res){
	Res->a=A->a*B->b-A->b*B->a;
	Res->b=A->b*B->b;
}

int Multiplication(Rational *A,Rational *B,Rational *Res){
	Res->a=A->a*B->a;
	Res->b=A->b*B->b;
}

int Devision(Rational *A,Rational *B,Rational *Res){
	Res->a=A->a*B->b;
	Res->b=A->b*B->a;
}

int Compare(Rational *A,Rational *B){
	if(A->a*B->b > B->a*A->b)return 1;
	else if(A->a*B->b == B->a*A->b)return 0;
	else return -1;
}

void PutRational(Rational *Res){
	printf("%d/%d\n",Res->a,Res->b );
}
